import logging

from requests import Session

from config import HOST


class ApproveApi:
    def __init__(self, session: Session):
        self.__session = session

    def approve_api(self, real_name, card_id):
        data = {"realname": real_name, "card_id": card_id}
        logging.info(F"实名认证接口 / 请求方法: post / 请求url: {HOST}/member/realname/approverealname / 请求数据{data}")
        return self.__session.post(HOST + "/member/realname/approverealname", data=data, files={"x": "y"})

    def get_approve_api(self):
        logging.info(
            F"获取认证信息接口 / 请求方法: post / 请求url: {HOST}/member/member/getapprove")
        return self.__session.post(HOST + "/member/member/getapprove")

    def trust_api(self):
        logging.info(
            F"后台开户接口 / 请求方法: post / 请求url: {HOST}/trust/trust/register")
        return self.__session.post(HOST + "/trust/trust/register")

    def tripartite_trust_api(self, url, data):
        logging.info(
            F"三方开户接口 / 请求方法: post / 请求url: {HOST}/trust/trust/register / 请求数据{data}")
        return self.__session.post(url, data=data)

